<template>
    <a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol">
      <a-form-model-item label="姓名">
        <a-input v-model="form.name" />
      </a-form-model-item>
      <a-form-model-item label="性别">
        <a-select v-model="form.sex" placeholder="请选择性别">
          <a-select-option value="男">男</a-select-option>
          <a-select-option value="女">女</a-select-option>
        </a-select>
      </a-form-model-item>
      <a-form-model-item label="时间">
        <a-date-picker
          v-model="form.date1"
          show-time
          type="date"
          placeholder="选择一个日期"
          style="width: 100%;"
        />
      </a-form-model-item>
      <a-form-model-item label="即时交货">
        <a-switch v-model="form.delivery" />
      </a-form-model-item>
      <a-form-model-item label="活动类型">
        <a-checkbox-group v-model="form.type">
          <a-checkbox value="1" name="type">
            线上
          </a-checkbox>
          <a-checkbox value="3" name="type">
            线下
          </a-checkbox>
        </a-checkbox-group>
      </a-form-model-item>
      <a-form-model-item label="补充信息">
        <a-input v-model="form.desc" type="textarea" />
      </a-form-model-item>
      <a-form-model-item :wrapper-col="{ span: 14, offset: 4 }">
        <a-button type="primary" @click="onSubmit">
          创建
        </a-button>
        <a-button style="margin-left: 10px;">
          取消
        </a-button>
      </a-form-model-item>
    </a-form-model>
  </template>
  <script>
  export default {
    data() {
      return {
        labelCol: { span: 4 },
        wrapperCol: { span: 14 },
        form: {
          name: '',
          sex: undefined,
          date1: undefined,
          delivery: false,
          type: [],
          desc: '',
        },
      };
    },
    methods: {
      onSubmit() {
        console.log('submit!', this.form);
      },
    },
  };
  </script>
  